class CreateDidaticMaterials < ActiveRecord::Migration
  def self.up
    create_table :didatic_materials do |t|
      t.text :description, :null => false
      t.references :content, :null => false
      t.references :lesson, :null => false

      t.timestamps
    end
    add_index(:didatic_materials,[:content_id, :lesson_id], :unique => true, :name => "uk_didatic_material")
  end

  def self.down
    drop_table :didatic_materials
  end
end
